#ifndef NODESPOOL_CPP
#define NODESPOOL_CPP

template<class T>
class BinomialNodePool
{
private:
    unsigned int initialNumber;
    BinomialHeapNode<T>* freeNodes;
    unsigned int numOfFreeNodes;

public:
    BinomialNodePool();
    BinomialHeapNode<T>* getFreeNode();
    void releaseNode(BinomialHeapNode<T>* node);
};

template<class T>
BinomialNodePool<T>::BinomialNodePool()
{
    this->initialNumber = 600;
    this->numOfFreeNodes = 600;
    this->freeNodes = NULL;
    for (int i=0; i<this->initialNumber; i++)
    {
        BinomialHeapNode<T>* temp = new BinomialHeapNode<T>();
        temp->sibling = freeNodes;
        freeNodes = temp;
    }
}

#endif